package main

import (
	"fmt"
	"runtime"
	"time"
)

func main() {
	runtime.GOMAXPROCS(2)
	startTime := time.Now()
	a := func() {
		for i := 1; i < 10; i++ {
			fmt.Println("a:", i)
		}
		fmt.Println("-----------------------------")
		time.Sleep(time.Second)
	}

	b := func() {
		for i := 1; i < 10; i++ {
			fmt.Println("b:", i)
		}
		time.Sleep(time.Second)

	}

	go a()
	go b()
	endTime := time.Since(startTime)
	fmt.Println(endTime)
	time.Sleep(time.Second)

}
